package com.bawei.module_repair.repositort

import com.bawei.module_repair.api.RepairApi
import com.bawei.module_repair.api.RepairModel
import com.bawei.module_repair.model.RepairAddBody
import kotlinx.coroutines.flow.flow
import javax.inject.Inject

class RepairRepository @Inject constructor() {
    @Inject
    @RepairModel.SignApi
    lateinit var mineApi: RepairApi
    //维修列表
    fun getRepairApply() = flow {
        emit(mineApi.getRepairApply())
    }
    //报修
    fun getRepairApplyAdd(repairAddBody: RepairAddBody) = flow {
        emit(mineApi.getRepairApplyAdd(repairAddBody))
    }
    //删除报修
    fun getRepairApplyDelete(id: Int) = flow {
        emit(mineApi.getRepairApplyDelete(id))
    }
}